home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / insq.z / insq
Encoding:
Text File  |  2002-10-03  |  8.2 KB  |  130 lines

  1.  
  2.  
  3.  
  4. iiiinnnnssssqqqq((((DDDD3333))))                                                              iiiinnnnssssqqqq((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _iiii_nnnn_ssss_qqqq - insert a message into a queue
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  14.      _iiii_nnnn_tttt _iiii_nnnn_ssss_qqqq_((((_qqqq_uuuu_eeee_uuuu_eeee______tttt _****_q_,,,, _mmmm_bbbb_llll_kkkk______tttt _****_e_m_p_,,,, _mmmm_bbbb_llll_kkkk______tttt _****_n_m_p_))))_;;;;
  15.  
  16.    AAAArrrrgggguuuummmmeeeennnnttttssss
  17.      _q         Pointer to the queue containing message _e_m_p.
  18.  
  19.      _e_m_p       Pointer to the existing message before which the new message is
  20.                to be inserted.
  21.  
  22.      _n_m_p       Pointer to the new message to be inserted.
  23.  
  24. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  25.      _iiii_nnnn_ssss_qqqq inserts a message into a queue.  The message to be inserted, _n_m_p, is
  26.      placed in the queue pointed to by _q, immediately before the message, _e_m_p.
  27.      If _e_m_p is _NNNN_UUUU_LLLL_LLLL, the new message is placed at the end of the queue.  All
  28.      flow control parameters are updated.  The service procedure is scheduled
  29.      to run unless disabled by a previous call to _nnnn_oooo_eeee_nnnn_aaaa_bbbb_llll_eeee(D3).
  30.  
  31.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  32.      If _n_m_p was successfully enqueued, _iiii_nnnn_ssss_qqqq returns 1.  Otherwise, _iiii_nnnn_ssss_qqqq
  33.      returns 0.
  34.  
  35. UUUUSSSSAAAAGGGGEEEE
  36.      Messages are ordered in the queue based on their priority, as described
  37.      in _ssss_rrrr_vvvv(D2).  If an attempt is made to insert a message out of order in
  38.      the queue, then _n_m_p is not enqueued.
  39.  
  40.      The insertion can fail if there is not enough memory to allocate the
  41.      accounting data structures used with messages whose priority bands are
  42.      greater than zero.
  43.  
  44.      If _e_m_p is non-_NNNN_UUUU_LLLL_LLLL, it must point to a message in the queue pointed to by
  45.      _q, or a system panic could result.
  46.  
  47.    LLLLeeeevvvveeeellll
  48.      Base or Interrupt.
  49.  
  50.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  51.      Does not sleep.
  52.  
  53.      Driver-defined basic locks, read/write locks, and sleep locks may be held
  54.      across calls to this function.
  55.  
  56.    EEEExxxxaaaammmmpppplllleeee
  57.      This routine illustrates the use of _iiii_nnnn_ssss_qqqq to insert a message into the
  58.      middle of a queue.  This routine can be used to strip all the _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO
  59.      headers off all messages on a queue.  We traverse the list of messages on
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. iiiinnnnssssqqqq((((DDDD3333))))                                                              iiiinnnnssssqqqq((((DDDD3333))))
  70.  
  71.  
  72.  
  73.      the queue, looking for _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO messages (line 9).  When one is found, we
  74.      remove it from the queue using _rrrr_mmmm_vvvv_qqqq(D3) (line 10).  If there is no data
  75.      portion to the message (line 11), we free the entire message using
  76.      _ffff_rrrr_eeee_eeee_mmmm_ssss_gggg(D3).  Otherwise, for every _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO message block in the message,
  77.      we strip the _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO block off using _uuuu_nnnn_llll_iiii_nnnn_kkkk_bbbb(D3) (line 15) and free the
  78.      message block using _ffff_rrrr_eeee_eeee_bbbb(D3).  When the header has been stripped, the
  79.      data portion of the message is inserted back into the queue where it was
  80.      originally found (line 19).
  81.       _1111  _vvvv_oooo_iiii_dddd
  82.       _2222  _ssss_tttt_rrrr_iiii_pppp_rrrr_oooo_tttt_oooo_((((_qqqq_))))
  83.       _3333   _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
  84.       _4444  _{{{{
  85.       _5555   _mmmm_bbbb_llll_kkkk______tttt _****_eeee_mmmm_pppp_,,,, _****_nnnn_mmmm_pppp_,,,, _****_mmmm_pppp_;;;;
  86.       _6666   _mmmm_pppp _==== _qqqq_----_>>>>_qqqq______ffff_iiii_rrrr_ssss_tttt_;;;;
  87.       _7777   _wwww_hhhh_iiii_llll_eeee _((((_mmmm_pppp_)))) _{{{{
  88.       _8888        _eeee_mmmm_pppp _==== _mmmm_pppp_----_>>>>_bbbb______nnnn_eeee_xxxx_tttt_;;;;
  89.       _9999        _iiii_ffff _((((_mmmm_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _====_==== _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO_)))) _{{{{
  90.      _1111_0000             _rrrr_mmmm_vvvv_qqqq_((((_qqqq_,,,, _mmmm_pppp_))))_;;;;
  91.      _1111_1111             _iiii_ffff _((((_mmmm_ssss_gggg_dddd_ssss_iiii_zzzz_eeee_((((_mmmm_pppp_)))) _====_==== _0000_)))) _{{{{
  92.      _1111_2222                  _ffff_rrrr_eeee_eeee_mmmm_ssss_gggg_((((_mmmm_pppp_))))_;;;;
  93.      _1111_3333             _}}}} _eeee_llll_ssss_eeee _{{{{
  94.      _1111_4444                  _wwww_hhhh_iiii_llll_eeee _((((_mmmm_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _====_==== _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO_)))) _{{{{
  95.      _1111_5555                       _nnnn_mmmm_pppp _==== _uuuu_nnnn_llll_iiii_nnnn_kkkk_bbbb_((((_mmmm_pppp_))))_;;;;
  96.      _1111_6666                       _ffff_rrrr_eeee_eeee_bbbb_((((_mmmm_pppp_))))_;;;;
  97.      _1111_7777                       _mmmm_pppp _==== _nnnn_mmmm_pppp_;;;;
  98.      _1111_8888                  _}}}}
  99.      _1111_9999                  _iiii_nnnn_ssss_qqqq_((((_qqqq_,,,, _eeee_mmmm_pppp_,,,, _mmmm_pppp_))))_;;;;
  100.      _2222_0000             _}}}}
  101.      _2222_1111        _}}}}
  102.      _2222_2222        _mmmm_pppp _==== _eeee_mmmm_pppp_;;;;
  103.      _2222_3333   _}}}}
  104.      _2222_4444  _}}}}
  105. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  106.      _gggg_eeee_tttt_qqqq(D3), _pppp_uuuu_tttt_bbbb_qqqq(D3), _pppp_uuuu_tttt_qqqq(D3), _rrrr_mmmm_vvvv_qqqq(D3), _ssss_rrrr_vvvv(D2)
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                                                         PPPPaaaaggggeeee 2222
  125.  
  126.  
  127.  
  128.